Repository navigation
Read result tables and points with one RFC 4180 CSV reader; check outputs and choices of cached schemas - #40
Merged
Conversation
…puts and choices of cached schemas Issue 17: a points record with a quoted line break was split by readLines/splitCsv into several points. New LcCsv reads records (quoted commas, doubled quotes, line breaks, CRLF, BOM) for tables and points, validates the x/y columns and coordinates, and reports a malformed file as one sentence instead of misplaced annotations. Issue 20: most of the requested registry/schema validation was already in main (QP-1); the schema check now also refuses a choice parameter without choices and an output without a plain name and text type. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y2SN8SuEakTdiWy3F2WUqN
…ield is one line) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y2SN8SuEakTdiWy3F2WUqN
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue 17 (CSV with quoted line breaks)
Fixes #17
Root cause on current main: result tables already read quoted multi-line cells (QP-11,
readCsv), but points (placePoints) still usedreadLines+ a one-linesplitCsv, so a record with a quoted line break became several "points" (wrong coordinates, or an exception). There was also no validation of the x/y columns and no sentence for a malformed file.Fix: new
LcCsv.groovy(listed inparts.txt, 85 lines) is the one reader for tables and points. It handles quoted commas, doubled quotes, line breaks inside cells, CRLF, a missing last newline, a leading BOM and UTF-8.LcCsv.pointschecks they/xcolumns, the cell count of each record and that each coordinate is a finite number. Malformed input (unclosed quote, text after a closing quote, stray quote) raisesLcCsvErrorwith the record and line. The results window shows that as "Not placed on an image: ..." for points and "table 'x' cannot be shown: ..." for tables.readCsvandsplitCsvare removed.Tests:
tests/gui_test_parity_results_body.groovy: 14 new checks on the reader, points validation and a malformed table.tests/gui_test_adversarial_body.groovywith theSpotstool oftests/adversarial_appgaining anoteparameter: a real Toolkit run whose metadata cell holds a line break, comma, quotes and non-ASCII text must give one annotation with 3 points at the expected coordinates and 3 table rows with the full text.Issue 20 (registry and cached manifest validation)
Refs #20. Most of what the issue lists is already on main (QP-1,
LcRegistry.entryProblem,schemaProblem,fileReason,untrustedReason): types of name/module/python/prefix/pythonpath/runtime_path,schema.toolsmust be a list, tool ids and parameter identifiers, the cached schema's owner and group/other-write bits, the schema next to the entry, interpreter, folder and prefix permissions, and per-app skip reasons.README.mdalready states that owner/mode checks do not apply on Windows.schema.tools: nulland an input without a name are refused today with a reason.What was still missing, now added (the Fiji script's
choicerule plus the output shape the results window reads): achoiceparameter with no choices, and an output that is not an object with a plain name and a text type, are refused at discovery. A parameter of an unknown type stays a per-tool refusal in the form ("this tool cannot be shown"), the same as the Napari and Fiji hosts, by design, so one new type does not hide the other tools of an app.Tests: 19 new fixtures in
tests/gui_test_parity_trust_body.groovy(null / non-list tools, non-object tool, input and output, missing or non-text names, choice without choices, output with path-like name, non-text pythonpath item, runtime_path and module) plus one valid app with a choice and outputs that must still load.Checks run locally
LcCsv(13/13 pass).🤖 Generated with Claude Code
https://claude.ai/code/session_01Y2SN8SuEakTdiWy3F2WUqN
Generated by Claude Code
Generated by Claude Code